package com.cn.lp.jpa.cq.expression;


import com.cn.lp.jpa.cq.domain.CQField;

public interface CQOrderBy<TFrom> extends CQBuilder<TFrom> {

    CQOrderBy<TFrom> orderBy(CQField field);

    CQOrderBy<TFrom> orderByDesc(CQField field);

    default CQOrderBy<TFrom> orderBy(CQField field, boolean desc) {
        if (desc) {
            return orderByDesc(field);
        }
        return orderBy(field);
    }

}
